Golang - 條件式與迴圈



if-else

if condition {
    ...
} else {
    ...
}

switch

switch condition {
case c1:
    ...
case c2:
    ...
default:
    ...
}

for

for i := 0; i < count; i++ {
    ...
}

while

for {
    ...
}
#golang #GO







你可能感興趣的文章

關於 React 小書:渲染陣列裡的各個項目

關於 React 小書:渲染陣列裡的各個項目

ASP.NET Core Web API 入門教學 - 關鍵字搜尋

ASP.NET Core Web API 入門教學 - 關鍵字搜尋

學習筆記搬新家─來到 CoderBrige

學習筆記搬新家─來到 CoderBrige






留言討論